Script Syntax

Outlined below is the meaning of the switches produced by the Folder Synchronize Script Editor. The scripts produced are ASCII text files (PC format). You can edit them using a standard text editor such as Notepad.

Scripts are passed to Folder Synchronize or Directory Toolkit using this syntax:

Folder Synchronize -

FOLDSYNC.EXE <script file>

Example:

foldsync.exe "D:\Script Files\Script2.sfs"

Directory Toolkit -

DIRTKT.EXE /c<script>

Example:

DIRTKT.EXE /c"D:\Script Files\Script1.sfs"

Please see the Folder Synchronize &/or Directory Toolkit documentation for more information on command line usage. Also, be sure to use the Windows start /w in your .bat/.cmd files to keep mutliple instances of the program from launching at the same time.

The script switches are listed below. A text file named FoldSyncSyntax.sfs containing the information below is included with the program distribution.

# Folder Synchronize (Ver 2.6+)

# Directory Toolkit Command Script Syntax (Ver 4.0+)

# Funduc Software, Inc

# Copyright 1997-2005

# http://www.funduc.com    http://www.searchandreplace.com

# support@funduc.com     support@searchandreplace.com 

 

# Comment lines in a script are prefaced with # or ' characters

# in column 1. The comment characters _must_ go in column 1.

# Comments should not be placed after script commands -- keep

# comments on separate lines from your working script switches.

 

# Blank lines are ignored.

 

# Note: All script commands and comments must begin in column

# 1!!!

 

# Please see the Folder Synchronize &/or Directory Toolkit

# program documenation for more information about usage.\

 

# GENERAL COMMENTS

# ================

# The [Default] Section, which is optional, is used to specify

# parameters for all [Action ]s in the script. You can also

# specify parameters specific [ActionX] section(s). For example,

# see [Action3] section below. All scripts must have at least

# one [Action ] section!! For this model script, [Action1] and

# [Default] are redundant -- both have the same path settings. In

# actual use, for single [Action] scripts you would not specify

# [Default] and would instead use [Action1] alone

 

# If present, [Default] should always be specified first. The

# order of processing for the [Action ] sections is determined by

# their number. They can be placed in any order within the

# script. Furthermore, numbers do not need to be inclusive --

# you can skip numbers. For example, if your script has

# [Action8] [Action2] [Action5] they will be processed in the

# order: [Action2] [Action5] [Action8]. Please see the F1 hlp

# for more information.

 

[Default]

 

# *** PATH SETTING ***

# Note: If Path1= or Path2= setting are listed in [Default],

# create a [Action1] tag with no Path1= or Path2= setting in

# order to use Path1= or Path2= as specified in [Default]. If

# your [Action1] section has a Path1= and Path2= settings they

# will supercede what is specified in [Default].

Path1=D:\Test\Folder1

Path2=D:\Test\Folder2

 

# *** FILE MASK ***

# File masks are specified with the Mask= switch. Complex file masks

# can be used. If no mask is specified the default assumed is *.*

# If you have Directory Toolkit, see the Directory Toolkit complex

# mask dialog for a builder to help you construct complex masks.

# Some examples are:

# Mask                 Effect

# -------------------- -------------------------------------

# *.i??                Include files ending with .i followed

#                        by 3 characters

# win.ini              This would be found by the above.

# ~moricons.dll        Exclude this specific file.

# ~\images\te*\        A wildcard (te*) to skip images\test,

#                        images\testing, etc.

# ~\*\junk*\*\*.*      Skips all files in any subdir junk*

#                        and all under that.

#

# All subdir specifications are relative Path1= and Path2=

# Separate multiple specifications with ; character. For example,

# *.*;~\*\junk*\*\*.*

#

Mask=*.*

 

# *** PROCESS SUBDIRECTORIES ***

# Use the switch here to include or not include subdirectories.

# The default is 1, for search and process all subdirectories.

# If not specified, Default = 1.

# Possible Values:

# 0 = Do not recurse subdirs

# 1 = Include subdirs

Search_subdir=1

 

# *** SYNCHRONIZE/COMPARE OPERATION TO PERFORM ***

# Use the Operation= switch to control which synchronize

# operation to perform. If not specified, Default Operation = 6.

# Use only one switch per [ActionX] section. Use a value of 6

# (Compare Only) to generate an output report without performing

# any synchronize operations.

 

# The - value, 'prompted' switches below trigger a synchronize

# dialog that waits for user input. Version 2.7 of Folder

# Synchronize has additional prompt choices that are not

# available in the Script Editor. See the Folder Synchronize

# documentation for more information and a version of the file

# you are reading specific for Folder Synchronize v 2.7.

 

# To cause Directory Toolkit to display two paths in a compare

# but take no further action:

# - Make a script with only one [Action]. You must have only

#   one action, otherwise selecting OK in the synchronize

#   dialog will cause the program to continue on to the next

#   step.

# - Use Operation=-8

# - Select the OK button in the Synchronize dialog.

# Alternatively, use the Directory Toolkit /s and /t command line

# switches to launch the program on the two paths in question.

 

# SWITCH VALUE

#                    No

# OPERATION        Prompt Prompted ACTION

# ---------------- ------ -------- ------------------

# Synchronize        0       -2     Update & Add in both directions.

# Augment            1       -3     Add only new to target.

# Refresh            2       -4     Update only existing in target.

# Update             3       -5     Update & Add new to target.

# Prune              4       -6     Update, Add new, Remove Orphans.

# Remove Identical   5       -7     Remove identical files from target.

# Compare Only       6       -8     Display only - No synch operations.

# Recreate Dirs      7       -9     Recreate directory structure only.

#                                     No other files are copied.

# Delete Empty Dirs  8       -10    Delete empty directories from the

#                                     target. No other files are copied.

# Custom Operation   9       -11    Custom synch operations using the

#                                     Synch Flags= switch. See below!!

# Prompt only                -1     Display synch dialog with no default.

Operation=1

 

# *** OUTPUT FILE FUNCTIONS ***

# To create an Output File of the results, specify a path & file

# name using the Output File= switch. Leave blank to not write

# an output file To write to the output file in Append mode, use

# the Append to Output File=1 setting.

# IMPORTANT: Use a path for the output file other than one being

# used during a synchronize operation. If your output file is in

# a path that is being actively synchronized you may get file

# sharing errors. It is OK to define different Output Files for

# each [ActionX] section. Possible Values for append switch:

# 0 = Output file is overwritten.

# 1 = Output writes are in append mode.

Output File=

Append to Output File=1

 

# *** PREVIEW YOUR OPERATIONS ***

# NOTE: This function is only available in Folder Synchronize.

# It is not supported by Folder Synchronize Script Editor so if

# you need this, edit your script manually with a text editor.

# The Destination Path= switch, if specified, is the path to copy

# the file(s) to instead of the Path2= path. For example, if

# your synchronize choice determines that letter.doc would be

# copied from the Source to the Target, if a path is specified in

# Destination= , letter.doc would be copied there instead.

# Destination Path=c:\tools\foldsync\test_results

 

# *** PROGRESS METER ***

# NOTE: This function is only available in Folder Synchronize.

# Directory Toolkit ignores this switch.

# The progress meter can be enabled/disabled with this switch.

# To make the program completely silent, disable both

# confirmations and the progress meter. The default is to

# display the meter.

# Possible Values:

# 0 = No meter

# 1 = Progress meter enabled

Show Progress=1

 

# *** DISABLE/ENABLE CANCEL BUTTON ***

# NOTE: This function is only available in Folder Synchronize.

# Directory Toolkit ignores this switch.

# Use the values here to disable/enable the cancel button.

# The default is that cancel is permitted.

# Possible Values:

# 0 = Disable Cancel button

# 1 = Enable Cancel button

Allow Cancel=1

 

# *** MESSAGE TO DISPLAY ***

# NOTE: This function is only available in Folder Synchronize.

# Directory Toolkit ignores this switch.

# Specify a brief, single line message here to be displayed

# in the progress meter.

# Custom Message=Performing a synchronize....

 

# *** DISPLAY CUSTOM BITMAP ***

# NOTE: This function is only available in Folder Synchronize.

# Directory Toolkit ignores this switch.

# The program can display a bitmap (transparent) using the using

# the bottom left pixel as the transparent color.

# Bitmap File=D:\Scripts\Test1.bmp

 

# *** DISPLAY ERROR MESSAGES ***

# Use the Display Error Messages= switch to control whether or

# not the program issues small 'Action Completed' message

# boxes after a script is complete. We recommend setting this

# switch to Display Error Messages=1 if you are doing operations

# to/from floppy media because this will help the program detect

# some OS-related driver error messages for some manufacturer's

# drivers such as zip disks, CDRW drives, etc. For totally

# silent operations specify Display Error Messages=0.

Display Error Messages=1

 

# *** REPLACEMENT CONFIRMATIONS ***

# Controls whether prompting for replaces is made.

# The Use OS Operations=1 switch determines the style of the

# prompting offered. If not specified, Default = 1.

# If not specified, Default = 1.

# Possible Values:

# 0 = No update prompts for file replacements are supplied.

# 1 = Confirmation prompts will be made.

Confirm Updates=1

 

# *** BINARY FILE CONTENTS COMPARISON ***

# Use this to perform a byte level contents comparison when two

# files have an alike name but different file date. The files

# will be considered identical if the contents are the same.

# Enable this only if you need it -- because the entire file must

# be read, processing will be slower, especially when network

# paths are involved. If not specified, Default = 0.

# Possible Values:

# 0 = Do not perform binary file comparison.

# 1 = Perform binary file comparison.

Check Same Size Files=0

 

# *** BINARY FILE CONTENTS COMPARISON - SAME DATE FILES ***

# To not perform a binary contents check on same date/size files,

# turn off the Binary Check Same Date Files= switch.

# This will speed up operations when Check Same Size Files=1 is

# enabled. However, use this only if you are sure your same

# date/size files are identical. This switch has no effect if

# Check Same Size Files=0 is in place. Default = 1.

# Possible Values:

# 0 = Do not binary compare same size/date files.

# 1 = Perform binary file compare on all files.

Binary Check Same Date Files=1

 

# *** UNIX COMPARE MODES ***

# Two special 'Unix' Directory Compare modes are available as a

# subset of Binary File Comparison (above) to compare files that

# have matching date/time stamps but different file sizes. The

# first, 'Ignore Whitespace Compare', disregards whitespace

# including spaces and line terminators. This mode can be used

# to compare Unix vs. PC files that are the same name and have

# matching time/date stamps. The second, 'Ignore Case Compare',

# disregards the case of the text within the files.

# Important Notes - Please Read:

# - The Check Same Size Files=1 switch MUST also be specified for

#   either of these switches to work.

# - Ignore Whitespace Compare can be done alone.

# - To use Ignore Case Compare you MUST also enable Ignore

#   Whitespace Compare.

# - The default for both switches if not specified is =0, e.g.,

#   Ignore Whitespace Compare=0, Ignore Case Compare=0

# Settings if you want Unix Compare alone:

#   Check Same Size Files=1

#   Ignore Whitespace Compare=1

#   Ignore Case Compare=0

# Settings if you want Unix Compare and Ignore Case Compare:

#   Check Same Size Files=1

#   Ignore Whitespace Compare=1

#   Ignore Case Compare=1

 

# *** DISPLAY DIFFERENT / IDENTICAL FILES ***

# Use these switches to control whether the program includes

# different &/or identical in your synchronize or comparison

# operation. If not specified, Default = 1.

# Values:

# 0 = Do not include those files

# 1 = Include those files

Show Different=1

Show Identical=1

 

# *** LOCATE SAME NAMED FILES ***

# Use the Match In Subdir=1 switch to enable a special mode to

# search for duplicate files files on your disk, e.g., to scan for

# duplicate DLLs or ferret out like-named documents across

# different subdirectories. In general, you would specify the

# same path for Path1= and Path2= when using this mode, although

# other two different paths can be scanned as well. Do not enable

# Match In Subdir=1 if you do not need it - the file lists returned

# are generally not what you would want for a typical

# synchronize operation. Operation=6 is the most common usage.

# If not specified, Default = 0.

# Values:

# 0 = Do not search for duplicate files in the paths.

# 1 = Perform a Match Duplicate Files comparison.

Match In Subdir=0

 

# *** TIME CHECK PRECISION ***

# Because NT-class operating systems such as Windows NT/2000/XP

# use a more accurate time stamp than Windows 95/98, comparisons

# between a Win95/98 and NT-class machine may lead to false

# mismatches a second apart (Win95/98 precision is on even

# seconds). The Time Check Precision= switch can be used to

# establish a +/- range, inside of which two files will be

# considered identical if their name & size are the same. Specify

# the value in seconds to use for Time Check Precision.

# Specify the value in seconds to use for Time Check Precision.

# If not specified, Default = 3.

Time Check Precision=3

 

# *** PATH 2 TIME COMPENSATION ***

# Note: This switch is not supported by Folder Synchronize Script

# Editor so if you need this, edit your script manually with a

# text editor.

# The Add Seconds To Second Dir= switch can be used compensate

# for a known, exact time difference between two paths. This

# switch can be useful if time zone differences are affecting the

# reported file times for one or the other path and if you do not

# wish to use 'Binary File Contents' compare mode (Check Same

# Size Files= switch). If Add Seconds To Second Dir= is

# specified the program adds or subtracts the specified number of

# seconds from the reported file times for Path2.

# For example, if a file time stamp is 08:00 and Add Seconds To

# Second Dir= 3600 is specified, the program will use 09:00 for

# the file time when evaluating comparisons. The value can be +

# or -. All files in path2 are affected. Add Seconds To Second

# Dir= is a fixed value, not a range. Omit this switch entirely

# if you do not need it.

# Add Seconds To Second Dir=

 

# *** USE OS vs INTERNAL CONFIRMATION DIALOGS ***

# The Use OS Operations= switch controls the type of file

# confirmation dialog used: internal file vs. standard Windows

# dialogs. The internal dialogs provide more information and

# choices than the native Windows dialogs. Some network drivers

# & removable media may require 'native' mode. If you have

# trouble with subdirs not being created on a path, try

# Use OS Operations=1. If not specified, Default = 1.

# Possible Values:

# 0 = Use internal file confirmation dialogs.

# 1 = Use native OS file operations.

Use OS Operations=0

 

# *** INCLUDE FILES THAT EXIST ONLY IN ONE PATH ***

# Show Files in 1 Dir= is used to control whether orphan files in

# one or the other path are included in an operation. In most

# cases you will probably want Show Files in 1 Dir=1. If not

# specified, the default = 1.

# Possible Values:

# 0 = Do not include files that exist in one dir only.

# 1 = Include files that exist in one directory only.

Show Files in 1 Dir=1

 

# *** CASE SENSITIVE NAME MATCHING ***

# Use this to compare file names case sensitive or not. If not

# specified, Default = 0.

# Possible Values:

# 0 = File name matching not case sensitive.

# 1 = File name matching is case sensitive.

Case Sensitive=0

 

# *** OVERWRITE BLOCKS - NEWER &/or OLDER FILES ***

# The two switches below are used to prevent the replacement of

# newer and/or older files. For safety reasons you probably should

# keep 'Newer Overwrite' turned off -- If enabled, a synchronize

# could replace newer files with older versions!!! If 'Newer

# Overwrite' is not specified the program default is disabled.

# 'Older Overwrite' should probably be enabled (this is the

# default). If you disable 'Older Overwrite', older versions of

# files will not be updated with newer versions during a

# synchronize. If not specified, Newer Overwrite=0 and

# Older Overwrite= 1.

# Possible Values:

# 0 = Do not overwrite.

# 1 = Allow overwrites.

Newer Overwrite=0

Older Overwrite=1

 

# *** GROUPING SIMILAR FILES ***

# When Group Files=1 is specified, the program clusters files in

# a comparison display by file name, with orphaned files grouped

# at the top or bottom of the list. When Group Files=0,

# comparisons are organized such that 'missing' or 'unmatched'

# files are visible within the context of other files according

# to the sort order. If not specified, Default = 0.

# Possible Values:

# 0 = Do not group files.

# 1 = Group files.

Group Files=0

 

# *** DISPLAY AND OUTPUT COLUMN SETTINGS ***

# The Display Columns= and Output Columns= switches can be used

# to control the layout of Directory Toolkit's GUI display and

# the layout of the output report in Directory Toolkit and Folder

# Synchronize. The default used for a script are the settings in

# place when the program was last run interactively. Describing

# the possible manual settings is complicated. Please see

# 'ScriptColumnDefinitionSettings.txt', that is installed in the

# program path, more information and some example settings.

# Display Columns=

# Output Columns=

 

# *** SORTING OPTIONS ***

# To sort the file listing, use one of the values below.

# To control ascending vs descending, use the Sort Type=

# switch.

# Field to sort on:

# SORT_BY_NONE = -1 (default if nothing specified)

# SORT_BY_NAME = 0

# SORT_BY_TYPE = 1

# SORT_BY_DATE = 2

# SORT_BY_SIZE = 3

# SORT_BY_PATH = 4

# SORT_BY_CHKSUM = 5

# SORT_BY_CRC32 = 6

# SORT_BY_ADATE = 7

# SORT_BY_CDATE = 8

Sort Compare=-1

 

# For Ascending vs Descending, Sort Type= values are:

# 0 = Descending

# 1 = Ascending

Sort Type=1

 

# *** FILTERING FILES ***

#

# The Mask= switch filters files by name &/or path.

 

# Other switches are available to filter files by size, date, and

# file attribute. Reverse Filters= switch is used to cause these

# switches to function as 'exclude' or 'include'.

#

# The values at below are the defaults if not specified (all

# files included). Omit those entirely if you do not need any

# special settings. The switches work in tandem with each other

# and the combinations of values is very complex. Please see the

# file, 'ScriptFilterSettings.txt', that is installed with the

# program for more information.

#

# Also note that you can use the string, %%today%%, for the two

# date filters. When specified, %%today%% automatically uses the

# current computer date for the respective filter setting. You

# can add or subtract days by specifying a +/- value before the

# ending %%. Examples: %%today-5%% uses a date filter of the

# current date minus 5 days; %%today+1%% adds one day to the

# current date.

 

# Max Size Filter=

# Min Date Filter=

# Max Date Filter=

# Skip Files Mask=0

# Ignore Attributes=55

# Reverse Filters=0

 

# *** ADDITIONAL ACTIONS ***

#

# Scripts can carry out more than one action. To do this, make

# [ActionX] as modeled below. They can be specified in any

# order in the script. The program parses the entire

# script and implements the 'Actions' sequentially, based

# on their number,

# e.g., [Action1], [Action2], [Action3], etc.

# Setting specified in [Default] will be in effect if that same

# switch is not specified in a given Action section.

 

[Action1]

Path1=D:\Test\Folder1

Path2=D:\Test\Folder2

Mask=*.*

Search_subdir=0

Operation=6

 

[Action2]

Path1=D:\Test\Folder1\SubFolder

Path2=D:\Test\Folder2\SubFolder

Mask=*.*

Search_subdir=0

Operation=1

Confirm Updates=0

 

[Action3]

Path1=C:\My Documents\Current Projects

Path2=C:\My Documents\Backup

Operation=2

Mask=*.doc;*.txt;~\*\Project10\*\*.doc

Confirm Updates=1

Search_subdir=1